package com.shop.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


@WebServlet("/getShop")
public class getShopServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    
    public getShopServlet() {
        super();
    }

	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String parm = request.getParameter("key");
		System.out.println(parm);
		if (parm.equals("Apple/Iphone X")) {
			response.sendRedirect("product_info.jsp?png=2");
		}else if (parm.equals("Apple/Iphone 5s")) {
			response.sendRedirect("product_info.jsp?png=3");
		}else if (parm.equals("honor/荣耀10")) {
			response.sendRedirect("product_info.jsp?png=4");
		}else if (parm.equals("Huawei/华为 p20")){
			response.sendRedirect("product_info.jsp?png=5");
		}else if (parm.equals("vivo Y75s")) {
			response.sendRedirect("product_info.jsp?png=6");
		}	

		
	}

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
